package chai.ning.args;

public class Sinaean {
	
	private String name ;
	private int age ;
	private char gender ;
	private boolean married ; // true 表示已婚，false 表示未婚
	
	public void assign( String name , int age , char gender , boolean married ) {
		this.name = name ;
		this.age = age ;
		this.gender = gender ;
		this.married = married ;
	}
	
	// 判断 自己 ( this ) 和 另外一个人 (another) 是否可以结婚
	public void marry( Sinaean another ) {
		
		// 1、异性
		// 2、双方均未婚
		// 3、男方22岁、女方20岁
		if( (this.gender == '男' & another.gender == '女') || (this.gender == '女' & another.gender == '男')){
			if( (this.married == false & another.married == false) || (this.married == false & another.married == false)){
				if( (this.age > 22 & another.age > 20) || (this.age > 20 & another.age > 22)){
					System.out.println(this.name +"和"+ another.name +"是可以结婚的，，华子！！ ");
				}else {
					System.out.println("草率了，，华子" );
				}
			}else {
				System.out.println("可惜了，，华子" );
			}
		}else {
			System.out.println("滚犊子，，华子" );
		}
	}
	public static void main(String[] args) {
		Sinaean sinaean = new Sinaean();
		sinaean.assign("大郎" , 33 , '男' , false);
	
		Sinaean sinaean1 = new Sinaean();
		sinaean1.assign("金莲" , 22 , '女' , false);
		sinaean1.marry(sinaean);
		
		Sinaean sinaean2 = new Sinaean();
		sinaean2.assign("华子", 45, '男', false);
		sinaean2.marry(sinaean1);
		
	}

}
